import { createBrowserRouter, Navigate } from "react-router-dom";

import Home from "../view/Home/Home";
import Login from "../view/Login/Login";
import Register from "../view/Register/Register";
import Place from "../view/Place/Place";
import My from "../view/My/My";
import Ticketing from "../view/Ticketing/Ticketing";
import Message from "../view/Message/Message";
import List from "../view/List/List";
import Particulars from "../view/Particulars/Particulars";
import Ddxq from "../view/Ddxq/Ddxq";
import Zfcg from "../view/Zfcg/Zfcg";

const routers = [
  {
    path: "/",
    element: <Navigate to={'/home/:place'}/>,
  },
  {
    path: "/home/:place",
    element: <Home></Home>,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/register",
    element: <Register></Register>,
  },
  {
    path: "/place",
    element: <Place></Place>,
  },
  {
    path: "/my",
    element: <My></My>,
  },
  {
    path: "/ticketing",
    element: <Ticketing></Ticketing>,
  },
  {
    path: "/message",
    element: <Message></Message>,
  },
  {
    path: "/list",
    element: <List></List>,
  },
  {
    path: "/particulars/:idx",
    element: <Particulars></Particulars>,
  },
  {
    path: "/ddxq",
    element: <Ddxq></Ddxq>,
  },
  {
    path: "/zfcg",
    element: <Zfcg></Zfcg>,
  },
];

const router = createBrowserRouter(routers);

export default router;
